<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">
  </div>

  <script>
    // 定义myMixin对象
    var myMixin = {
      created() {
        this.hello();
      },
      methods: {
        hello() {
          console.log("hello from mixin");
        }
      }
    }

    var Component = Vue.extend({
      mixins: [myMixin],
    })

    var component = new Component();

    // var vm = new Vue({
    //   el: "#app"
    // })
  </script>
</body>

</html>